package com.geostar.constructionland.index.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class FormatUtils {

     public static List<String> getStringByList(String strCondition){
         String[] conditions=strCondition.split(",");
         List<String> conditionList = new ArrayList<String>();
         for (String condition : conditions) {
             conditionList.add(condition);
         }
         return conditionList;
     }

     public static Date formatStringByDate(String dataStr){
         SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
         sdf.setLenient(false);
         //将字符串转为date类型
         Date date=new Date();
         try {
             //将字符串转为date类型
             date= sdf.parse(dataStr);

         } catch (ParseException e) {
             e.printStackTrace();

         }

         return date;
     }
}
